home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr29 / murexx04.zip / CHKEXP.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-10  |  1KB  |  46 lines

  1. /* MaxUserREXX Examples                                                    */
  2. '@echo off'
  3.  
  4. /* Setup the catch all loader for the user functions                       */
  5. Call RxFuncAdd 'UserLoadFuncs', 'MaxUser', 'UserLoadFuncs'
  6.  
  7. /* Load all the user functions at once                                     */
  8. Call UserLoadFuncs
  9.  
  10. /* Define some constants                                                   */
  11. UserError = 'ERROR'
  12. UserFile = 'D:\MAX\USER.BBS'
  13.  
  14. /* Open the user file for use */
  15. UserCount = OpenUserFile(UserFile)
  16.  
  17. if UserCount <> UserError then do
  18.     Signal On Syntax Name BadCommand
  19.     Signal On Halt Name BadCommand
  20.     index = 0
  21.     Say '  U#   Name                 Expiration Information'
  22.     Say ' ---- -------------------- ------------------------------'
  23.     do until index = UserCount
  24.         UserLevel = QueryUserPriviledge(index)
  25.         UserExpInfo = QueryUserExpiryInfo(index)
  26.         if (UserLevel='EXTRA' & UserExpInfo<>'NONE,NONE') then do
  27.             Say Right(index, 5)' 'Left(QueryUserName(index), 20)' 'UserExpInfo
  28.         end
  29.         index = index + 1
  30.     end
  31.  
  32.     /* Close up shop and free the system resources */
  33.     Call CloseUserFile
  34. end
  35.  
  36. /* We are done, so we can drop all the functions                           */
  37. Call UserDropFuncs
  38. Exit
  39.  
  40. BadCommand:
  41.     Say
  42.     Say 'REXX Error ('rc')'
  43.     Call CloseUserFile
  44.     Call UserDropFuncs
  45.     Exit
  46.